
body {
    font-family: Arial, sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f8f8;
}

.logo img {
    height: 50px;
}

.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-bar button {
    padding: 5px 15px;
    background-color: #ff6347;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-info a {
    margin-left: 10px;
    color: #333;
    text-decoration: none;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    background-color: #333;
    color: white;
}

nav ul li {
    padding: 10px 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

main {
    padding: 20px;
}

.featured-products, .promotions {
    margin-bottom: 20px;
}

.featured-products h2, .promotions h2 {
    color: #333;
}

.product-list, .promotion-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

footer {
    background-color: #777;
    color: white;
    text-align: center;
    padding: 10px 0;
}

/* 添加一些响应式设计 */
body {
                            font-family: Arial, sans-serif;
                        }

.price {
    color: red; /* 将价格文本颜色设置为红色 */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f8f8;
}

.logo img {
    height: 50px;
}

.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-bar button {
    padding: 5px 15px;
    background-color: #ff6347;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-info a {
    margin-left: 10px;
    color: #777;
    text-decoration: none;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    background-color: #e0e0e0;
    color: #333;
}

nav ul li {
    padding: 10px 15px;
}

nav ul li a {
    color: #333;
    text-decoration: none;
}

.filters {
    padding: 10px;
    background-color: #f1f1f1;
    margin-top: 20px;
}

.filter-option {
    margin-bottom: 15px;
}

.filter-title {
    font-weight: bold;
}

.filter-item {
    display: inline-block;
    margin-right: 10px;
    padding: 5px 10px;
    background-color: #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.filter-item.selected {
    background-color: #ff6347;
    color: white;
}

main {
    padding: 20px;
}

.product-list {
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    gap: 10px; /* 减小商品之间的间距 */
    justify-content: center; /* 居中对齐商品 */
}

.product-item {
    width: calc(16.6666666667% - 10px); /* 每个商品占据25%的宽度，减去间距 */
    box-sizing: border-box; /* 包括内边距和边框在内的宽度计算 */
    background-color: #fff; /* 商品背景色 */
     /* 商品边框 */
    border: none;
    border-radius: 4px; /* 边框圆角 */
    padding: 10px; /* 内边距 */
    margin-bottom: 20px; /* 商品底部外边距，增加垂直间距 */
}

.product-item:hover {
    border: 1px solid #ddd; /* 当鼠标悬停时添加边框 */
}

.product-item img {
    max-width: 100%; /* 图片最大宽度为商品元素宽度 */
    height: auto; /* 图片高度自动 */
    border-radius: 4px; /* 图片圆角 */
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
}
/* 响应式设计调整 */
@media (max-width: 768px) {
    .product-item {
        width: calc(50% - 10px); /* 在小屏幕上每个商品占据50%的宽度 */
    }
}

@media (max-width: 480px) {
    .product-item {
        width: 100%; /* 在非常小的屏幕上每个商品占据100%的宽度 */
    }
}

@media (max-width: 768px) {
    .search-bar input, .search-bar button {
        width: 100%;
        margin-bottom: 10px;
    }
}
